from .MessageContent import *


class MessageContentFactory:
    _type_mapping = {
        "text": TextMessageContent,
        "image_url": ImageUrlMessageContent,
        "input_audio": InputAudioMessageContent,
        "video_url": VideoUrlMessageContent,
        "video": VideoMessageContent,
    }

    @classmethod
    def create(cls, type: str, **kwargs) -> MessageContentTypes:
        if type not in cls._type_mapping:
            raise ValueError(f"Invalid message content type: {type}")
        return cls._type_mapping[type](type=type, **kwargs)
